﻿Console.WriteLine("请输入第一个运算数");
string number_1 = Console.ReadLine();

Console.WriteLine("请输入第二个运算数");
string number_2 = Console.ReadLine();

Console.WriteLine("请输入运算符+,-,*,/");
string func = Console.ReadLine();

double num1 = Convert.ToDouble(number_1);
double num2 = Convert.ToDouble(number_2); 
char opt = Convert.ToChar(func);

double result = 0;

switch (opt)
{
    case '+': result = num1 + num2; break;
    case '-': result = num1 - num2; break;
    case '*': result = num1 * num2; break;
    case '/': result = num1 / num2; break;
    default:break;

}
Console.WriteLine("计算结果为：{0}",result);
Console.ReadKey();
